<?php 
	// wenn im Match, dann Topnavi ausblenden
	if($_SESSION['matchLock']){
		$hidden = "hidden";
		$show_disabled_topnavi = "";
	}
	else{
		$hidden = "";
		$show_disabled_topnavi = "hidden";
	}
?>

<form action="<?php echo $_SERVER['PHP_SELF']."?login"; ?>" method="post">
    <div class="navbar navbar-inverse navbar-fixed-top <?php echo $hidden;?>" id="topNavi">
        <div class="navbar-inner">
          <div class="container">
            <a class="brand" href=".">DotA2 League</a>
            <div class="nav-collapse collapse">
              <ul class="nav">
                <li><a href=".">Home</a></li>
                <li><a href="find_match.php">Find Match</a></li>
                <li><a href="help.php">FAQ</a></li>
              </ul>
              <p class="navbar-text pull-right">
                    <?php include("inc/templates/login_form.php");?>
              </p>
            </div><!--/.nav-collapse -->
          </div>
        </div>
      </div>
</form>

 <div class="navbar navbar-inverse navbar-fixed-top <?php echo $show_disabled_topnavi;?>">
        <div class="navbar-inner">
          <div class="container">
             <a class="brand">Project name</a>
            <div class="nav-collapse collapse">
             <!-- <ul class="nav">
                <li><a href=".">Home</a></li>
                <li class="active"><a href="find_match.php">Find Match</a></li>
                <li><a href="#contact">Contact</a></li>
              </ul>
              <p class="navbar-text pull-right">
                    <?php //include("inc/templates/login_form.php");?>
              </p>-->
            </div><!--/.nav-collapse -->
          </div>
        </div>
      </div>
      
<script type="text/javascript">
	// ACTIVE MENUPUNKT dynamisch generieren
	var home_path = "<?php echo HOME_PATH; ?>";
	var url = location.href;
	
	//Home_Parth abschneiden
	position = url.split(home_path);
	position = position[1];
	
	links = $("#topNavi ul[class='nav'] a");
	l(links);
	// alle delektieren
	$(links).closest("li").removeClass("active");
	
	$.each(links, function(index, value){
			l($(value).html());
			// Index.php gesondert behandelt
			if(position == "index.php" || position == ""){
				if($(value).html() == "Home"){
					$(value).closest("li").addClass("active");
				}	
			}
			else{
				if($(value).attr("href") == position){
					$(value).closest("li").addClass("active");
				}
			}
	});
	l(position);
	
</script>